package com.jilin.library.service;

import com.jilin.library.entity.Reader;
import com.jilin.library.mapper.ReaderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class ReaderService {
    @Autowired
    private ReaderMapper readerMapper;
    
    public List<Reader> findAll() {
        return readerMapper.findAll();
    }
    
    public Reader findById(Integer id) {
        return readerMapper.findById(id);
    }
    
    public Reader addReader(Reader reader) {
        readerMapper.insert(reader);
        return reader;
    }
    
    public int updateReader(Reader reader) {
        return readerMapper.update(reader);
    }
    
    public int deleteReader(Integer id) {
        return readerMapper.delete(id);
    }
} 